package com.wzgl.core.model;

import java.util.List;

import com.jfinal.log.Log;
import com.wzgl.core.base.Table;
import com.wzgl.core.baseModel.BaseSendLogo;

@Table(tableName = "tsendlogo", primaryKey = "fid")
public class TsendLogo extends BaseSendLogo<TsendLogo>{
	private Log log=Log.getLog(TsendLogo.class);
	private static final long serialVersionUID = -1L;
	public static final TsendLogo dao = new TsendLogo();
	
	public List<TsendLogo> getAll(){
		return dao.find("select * from tsendLogo");
	}

	/**
	 * 从缓存中读取日志记录，判断文章是否对该去向已经发布过。
	 * @param direction_id  去向id
	 * @param grid_id 文章id
	 */
	public TsendLogo findLogoByGidAndDid(String grid_id, String direction_id) {
		//后期使用缓存,前期不考虑
//		return dao.getCache(fid, new IDataLoader() {
//			@Override
//			public Object load() {
//				return dao.doFindFirst("fid = ?", fid);
//			}
//		});
		return dao.doFindFirst("fgrid_id = ? and fdirection_id = ?",grid_id,direction_id );
	}
	
	
}
